const gulp = require('gulp');
const $ = require('gulp-load-plugins')();
const config = require('../config/data');

let distDir = config.dirs.dist;

/**
 * 发布版本，打包
 */
gulp.task('release:build',
  gulp.series(
    // 'release:clear',
    // 'release:copy',
    'release-stylus',
    gulp.parallel('release:script', 'release:htmlmin'),
    // gulp.parallel('release:delEmptyDir')
  )
);

/**
 * 压缩dist目录
 */
gulp.task('zip', function () {
  return gulp.src([distDir + '/**/*'])
    .pipe($.zip(config.dirs.zipName + '.zip'))
    .pipe(gulp.dest(config.dirs.zip));
});
